<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>JEEWW DEMO</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
#parse("page_include.html")
</head>
<body>
	<div data-type="layout" data-define="fit:true">
		<div data-define="region:'north',border:false" style="height: 63px; padding: 0px;">
			<table width="100%" class="headbg">
				<tr>
					<td width="50%" class="headleftbg"></td>
					<td width="25%" align="right">
						<span style="color: #666633"><b>您好,&nbsp;XXX</b></span>
					</td>
					<td width="25%">
						<a id="delButton" href="#" data-type="menubutton" onclick="changeTheme()"
							data-define="iconCls:'icon-change-theme',plain:true,menu:'#changeThemeItems',">更改样式</a>
						<a id="editButton" href="javascript:void(0)" data-type="linkbutton" onclick="changePassword()"
							data-define="iconCls:'icon-change-password',plain:true">密码修改</a>
						<a id="addButton" href="${rc.contextPath}/j_spring_security_logout" data-type="linkbutton"
							data-define="iconCls:'icon-logout',plain:true">注销</a>
					</td>
				</tr>
			</table>
			<div id="changeThemeItems" style="width: 50px;">
				<div data-define="iconCls:'icon-theme-gray'" onclick="changeTheme('default')">default</div>
				<div data-define="iconCls:'icon-theme-blue'" onclick="changeTheme('blue')">blue</div>
				<div data-define="iconCls:'icon-theme-gray'" onclick="changeTheme('gray')">gray</div>
				<div data-define="iconCls:'icon-theme-yellow'" onclick="changeTheme('sunny')">sunny</div>
				<div data-define="iconCls:'icon-theme-yellow'" onclick="changeTheme('green')">green</div>
				<div data-define="iconCls:'icon-theme-yellow'" onclick="changeTheme('lavender')">lavender</div>
			</div>
		</div>
		<div data-define="region:'west',split:true,border:true" title="菜单信息" style="width: 230px;">
			<div data-type="accordion" data-define="fit:true">
				<div title="常用例子" data-define="selected:false">
					<ul id="nativeDemoTree1" data-type="tree" style="padding: 0px"
						data-define="
				method:'get',
				onClick : tree1OnClickFun,
				url:'${rc.contextPath}/assets/ui/jww/demo/index1no.json',
				animate:false,dnd:false"></ul>
				</div>
				<div title="组件演示" data-define="selected:false">
					<ul id="nativeDemoTree2" data-type="tree" style="padding: 0px"
						data-define="
				method:'get',
				onClick : tree2OnClickFun,
				url:'${rc.contextPath}/assets/ui/jww/demo/index2.json',
				animate:false,dnd:false"></ul>
				</div>
				<div title="API" data-define="selected:false">
					<ul id="nativeDemoTree2" data-type="tree" style="padding: 0px"
						data-define="
				method:'get',
				onClick : tree2OnClickFun,
				url:'${rc.contextPath}/assets/ui/jww/demo/index_api.json',
				animate:false,dnd:false"></ul>
				</div>
			</div>
		</div>
		<div data-define="region:'south',split:true,border:true" style="height: 50px; padding: 10px;">ccc</div>
		<div data-define="region:'center',title:'',border:true" style="padding-top: 0px;">
			<div id="bsTabs" data-type="tabs" data-define="fit:true,plain:false,border:false">
				<div title="欢迎页面" style="padding: 10px;" href="${rc.contextPath}/assets/ui/jww/jwwui.html"></div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var webRoot = "${rc.contextPath}";
        function tree1OnClickFun(node) {
	        if (node.attributes) {
		        var url = "${rc.contextPath}" + node.attributes.url;
		        addTab(node.text, url, '');
	        }
        }
        function tree2OnClickFun(node) {
	        if (node.attributes) {
		        //ajaxLoading();
		        //可以自己加类似于panel的loading标志
		        var url = "${rc.contextPath}/demo/redirectNewPage.do?redirectUrl=" + node.attributes.url;
		        addTab(node.text, url, '');
	        }
        }
        function changeTheme(themeId) {
	        if (themeId == null || themeId == "") {
		        return;
	        }
	        var links = $("LINK");
	        // for ( var i = 2; i < links.length; i++) {
	        for ( var i = 1; i < links.length; i++) {
		        var h = $(links[i]).attr("href");
		        var hh = h.split("themes");
		        var root = hh[0];
		        var ls = hh[1];
		        var theme = ls.split("/")[1];
		        var plug = ls.split("/")[2];
		        var v = root + "themes/" + themeId + "/" + plug;
		        $(links[i]).attr("href", v);
	        }
        }
	</script>
</body>
</html>